package com.example.sgxs_api.controller;

import com.example.sgxs_api.domain.Fruit;
import com.example.sgxs_api.mapper.FruitMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin(origins = "*")
@Slf4j
@RequestMapping("fruit")
@RestController
public class FruitController {
    @Autowired
    private FruitMapper fruitmapper;

    @RequestMapping("lookall")
    private List<Fruit> getALL(){
        List<Fruit> list = fruitmapper.getAllFruit();
        return list;
    }
}
